import React, { Component } from 'react'
import { Route,Switch,Redirect } from 'react-router-dom'
import Home from './pages/Home'
import About from './pages/About'
import Test from './pages/Test'
import MyNavLink from './components/MyNavLink'

import './css/routeApp.css'

export default class routeApp extends Component {
    render() {
        return (
            <div>
                {/* <NavLink to="/home" activeClassName="active" className="link">Home</NavLink>&nbsp;
                <NavLink to="/about" activeClassName="active" className="link">About</NavLink> */}

                <MyNavLink replace to="/home/1/zxczxczxc">Home</MyNavLink>&nbsp;
                <MyNavLink to="/about?id2=2&title2=qweqweqweqwe">About</MyNavLink>&nbsp;
                <MyNavLink to="/asd">Test</MyNavLink>

                <Switch>
                    <Route path="/home/:id/:title" component={Home}/>
                    <Route path="/about" component={About}/>
                    <Route path="/test" component={Test}/>
                    <Redirect to="/test"/>
                </Switch>
            </div>
        )
    }
}
